from sklearn.cluster import KMeans
from load_data import data

data = data()
# print(data)
kmeans = KMeans(n_clusters=3).fit(data) #default=’k-means++’
labels = kmeans.labels_
print("每个样本的簇标签为：",labels)
center = kmeans.cluster_centers_
print("每个簇的质心为：",center)
SSE = kmeans.inertia_
print("聚类结果的SSE值为：",SSE)



